﻿
namespace MVVM_S.Samples.HelpDesk.Web.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    // The MetadataTypeAttribute identifies CategoryMetadata as the class
    // that carries additional metadata for the Category class.
    [MetadataTypeAttribute(typeof(Category.CategoryMetadata))]
    public partial class Category
    {

        // This class allows you to attach custom attributes to properties
        // of the Category class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class CategoryMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private CategoryMetadata()
            {
            }

            public bool Active { get; set; }

            public string CategoryID { get; set; }

            public string CategoryName { get; set; }

            public EntityCollection<Ticket> Tickets { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies NoteMetadata as the class
    // that carries additional metadata for the Note class.
    [MetadataTypeAttribute(typeof(Note.NoteMetadata))]
    public partial class Note
    {

        // This class allows you to attach custom attributes to properties
        // of the Note class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class NoteMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private NoteMetadata()
            {
            }

            public DateTime Entered { get; set; }

            public string EnteredBy { get; set; }

            public int NotesID { get; set; }

            public string Text { get; set; }

            public Ticket Ticket { get; set; }

            public int TicketID { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies OfficeMetadata as the class
    // that carries additional metadata for the Office class.
    [MetadataTypeAttribute(typeof(Office.OfficeMetadata))]
    public partial class Office
    {

        // This class allows you to attach custom attributes to properties
        // of the Office class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class OfficeMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private OfficeMetadata()
            {
            }

            public bool Active { get; set; }

            public string OfficeID { get; set; }

            public string OfficeName { get; set; }

            public EntityCollection<Ticket> Tickets { get; set; }

            public EntityCollection<User> Users { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies TicketMetadata as the class
    // that carries additional metadata for the Ticket class.
    [MetadataTypeAttribute(typeof(Ticket.TicketMetadata))]
    public partial class Ticket
    {

        // This class allows you to attach custom attributes to properties
        // of the Ticket class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class TicketMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private TicketMetadata()
            {
            }

            public Category Category { get; set; }

            public string CategoryID { get; set; }

            public string Details { get; set; }

            public short EscalationLevel { get; set; }

            [Include]
            public EntityCollection<Note> Notes { get; set; }

            public Office Office { get; set; }

            public string OfficeID { get; set; }

            public DateTime Opened { get; set; }

            public Nullable<DateTime> Resolved { get; set; }

            public Nullable<int> ResolvedBy { get; set; }

            public User ResolvedByUser { get; set; }

            public User TicketFor { get; set; }

            public int TicketID { get; set; }

            public string Title { get; set; }

            public Nullable<DateTime> Updated { get; set; }

            public Nullable<int> UpdatedBy { get; set; }

            public User UpdatedByUser { get; set; }

            public Nullable<int> UserID { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies UserMetadata as the class
    // that carries additional metadata for the User class.
    [MetadataTypeAttribute(typeof(User.UserMetadata))]
    public partial class User
    {

        // This class allows you to attach custom attributes to properties
        // of the User class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class UserMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private UserMetadata()
            {
            }

            public bool Active { get; set; }

            public string DisplayName { get; set; }

            [Include]
            public EntityCollection<Ticket> MyTickets { get; set; }

            public Office Office { get; set; }

            public string OfficeID { get; set; }

            public string Phone { get; set; }

            public EntityCollection<Ticket> ResolvedTickets { get; set; }

            public EntityCollection<Ticket> UpdatedTickets { get; set; }

            public int UserID { get; set; }

            public string UserName { get; set; }
        }
    }
}
